package Interface_de_test;


import javax.swing.GroupLayout;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Button;

//import org.eclipse.swt.events.SelectionAdapter;
//import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.*;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.graphics.Point;
//import org.eclipse.swt.widgets.Text;


public class InterfaceStat {
	private static Group group;
	private static FillLayout fl_group;

	/**
     * Launch the application.
     * @param args
     */
    public static void main(String[] args) {
            Display display = Display.getDefault();
            Shell shell = new Shell();
            shell.setSize(800, 800);
            shell.setText("Statistical Application");
           
            /*Menu*/
            shell.setLayout(new FillLayout(SWT.HORIZONTAL));
            Menu menu = new Menu(shell, SWT.BAR);
            shell.setMenuBar(menu);
           
            MenuItem mntmFile_1 = new MenuItem(menu, SWT.CASCADE);
            mntmFile_1.setText("File");
           
            Menu menu_1 = new Menu(mntmFile_1);
            mntmFile_1.setMenu(menu_1);
           
            MenuItem mntmImporterDonnee = new MenuItem(menu_1, SWT.NONE);
            mntmImporterDonnee.setText("Importer Donnee");
           
            MenuItem mntmImporterModule = new MenuItem(menu_1, SWT.NONE);
            mntmImporterModule.setText("Importer Module !");
           
            MenuItem mntmQuit = new MenuItem(menu_1, SWT.NONE);
            mntmQuit.setText("Quit");
           
            MenuItem mntmEdit = new MenuItem(menu, SWT.CASCADE);
            mntmEdit.setText("Edit");
            Menu menu_3 = new Menu(mntmEdit);
            mntmEdit.setMenu(menu_3);
            
            MenuItem mntmPreference = new MenuItem(menu_3, SWT.NONE);
            mntmPreference.setText("Preference");
            
            MenuItem mntmHelp = new MenuItem(menu, SWT.CASCADE);
            mntmHelp.setText("Help ");
           
            Menu menu_2 = new Menu(mntmHelp);
            mntmHelp.setMenu(menu_2);
           
            MenuItem mntmHelp_1 = new MenuItem(menu_2, SWT.NONE);
            mntmHelp_1.setText("Help");
           
            MenuItem mntmAbout = new MenuItem(menu_2, SWT.NONE);
            mntmAbout.setText("About");
           
            Composite composite = new Composite(shell, SWT.NONE);
            composite.setSize(15, 30);
           
            /*Bouton*/
            composite.setLayout(new GridLayout(1, false));
            
            Button btnModStat = new Button(composite, SWT.NONE);
            btnModStat.setText("Mod Stat");
           
            Button btnModVisual = new Button(composite, SWT.NONE);
            btnModVisual.setText("Visual");
            
            Button btnModAutre = new Button(composite, SWT.NONE);
            btnModAutre.setText("Autre");
           
            /*Label*/
            /*Label label = new Label(shell, SWT.SEPARATOR | SWT.VERTICAL);
            label.setBounds(150, 50, 15, 500);
            
            Label label_3 = new Label(shell, SWT.SEPARATOR | SWT.VERTICAL);
            label_3.setBounds(700, 50, 15, 500);
           
            Label label_1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
            label_1.setBounds(158, 550, 549, 2);
           
            Label label_2 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
            label_2.setBounds(158, 50, 549, 2);
           
            Label lblVariablePart = new Label(shell, SWT.NONE);
            lblVariablePart.setBounds(391, 281, 82, 13);
            lblVariablePart.setText("VARIABLE PART");
             */
            group = new Group(shell, SWT.BORDER | SWT.SHADOW_IN);
            group.setBackground(SWTResourceManager.getColor(255, 255, 255));
            group.setTouchEnabled(true);
            fl_group = new FillLayout ();
            fl_group.type = SWT.VERTICAL;
            group.setLayout (fl_group);
            group.setText ("Actions");
            fl_group.marginHeight=50;
            fl_group.marginWidth=50;
            //group.setBounds(100, 100, 100, 100);
            //Button button1 = new Button(group, SWT.NONE);
            //button1.setText("Bouton 1");
           // Button button2 = new Button(group, SWT.NONE);
            //button2.setText("Bouton 2");
            
            
            shell.open();
            shell.layout();
            while (!shell.isDisposed()) {
                    if (!display.readAndDispatch()) {
                            display.sleep();
                    }
            }
    }

	public int getFl_groupMarginHeight() {
		return fl_group.marginHeight;
	}
	public void setFl_groupMarginHeight(int marginHeight) {
		fl_group.marginHeight = marginHeight;
	}
}
